// 导入通用的与服务器端交互的request.js文件
import service from '@/utils/request.js'
// 登录API
export const login = (data) => {
  return service({
    url: '/user/login', //后端的被访问的API
    method: 'POST',
    data: data,
  })
}
// 注销API
export const logout = () => {
  return service({
    url: '/user/logout',
    method: 'GET',
  })
}

// 检测用户是否已经成功登录过的API
export const checkIsLogin = () => {
  return service({
    url: '/user/check-login',
    method: 'GET',
  })
}
export const reg = (data) => {
  return service({
    url: '/user/reg', //后端的被访问的API
    method: 'POST',
    data: data,
  })
}